<?php 
if(empty($_SESSION['spelerId']) && isset($_COOKIE['inloggen']) && str_replace("&", "^", $_SERVER['REQUEST_URI']) <> "/session_functions/uitloggen.php") {
	header("Location: http://localhost.nl/session_functions/inloggen.php?cookie=1&target=".str_replace("&", "^", $_SERVER['REQUEST_URI']));
	die();
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mijnhonkbal</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="icon" href="/images/icon_57.png" />
<link rel="shortcut icon" href="/images/icon_57.png" />
<?php
//Style_nmr bepalen als dat nog niet gedaan is
//if(!isset($style_nmr)) {
//	$style_nmr = (isset($_SESSION['style']) && $_SESSION['style'] > 1 ? $_SESSION['style'] : "");
//}
//Main CSS file laden
echo "<link href='/bestanden/css/style".$style_nmr.".css' rel='stylesheet' type='text/css' />";
//FORM css laden
echo "<link href='/bestanden/css/form".$style_nmr.".css' rel='stylesheet' type='text/css' />";
//Jquery laden
echo "<script type='text/javascript' src='/bestanden/js/jquery-1.7.1.min.js'></script>";

// Sidebar arrow

//Het script om de aanwezigen te laten zien in de sidebar
if(isset($_SESSION['rechten']) && $_SESSION['rechten'] & (1 << 4)) {
	echo "<script type='text/javascript'>
	$(document).ready(function() {
		//Afmeldingen zichtbaar maken
		$('.sb_agenda_content').click(function() {
			$('.sb_agenda_aanwezigen').slideUp();
			$('.sb_agenda_content').removeClass('agenda_selected');
			if(!$(this).next('.sb_agenda_aanwezigen').is(':visible')) {
				$(this).next('.sb_agenda_aanwezigen:hidden').slideDown();
				$(this).addClass('agenda_selected');
			}
		});
		$('.sb_agenda_aanwezigen').click(function() {
			$(this).slideUp();
			$('.sb_agenda_content').removeClass('agenda_selected');
		});
	});
	</script>";
}

//Extra bestanden of codes uitvoeren die van de geselecteerde pagina af komen
if(isset($bestanden)) {
	echo $bestanden;
}
?>
</head>
<body <?php echo (isset($no_style) ? "id='body_no_style'" : "") ?>>
<div id="wrapper">
<div id="subwrapper">
<?php
if(empty($no_style)) {
	if(empty($_SESSION['style']) || $_SESSION['style'] == 1 || $_SESSION['style'] == 3) {
		?>		
		<div id="header">
		<div id="subheader">
		<!-- <h1><a href="./">Piostats</a></h1> -->
		<h1>mijnhonkbal</h1>
		<!-- <p class="subtitle">De site voor je honkbalteam</p> -->
		</div>
		</div>
		<div id="menu">
		<div id="submenu">
		<!-- <ul>
			<li><a href="/">Home</a></li>
			<li><a href="/schema/">Wedstrijdschema</a></li>
			<li><a href="/stats/">Statistieken</a></li>
			<li><a href="/kalender/">Kalender</a></li>
		</ul> -->
		<?php
		if($spelerId > 0) {
			// De speler is ingelogd, laat de subonderdelen zien
			?>
			<!--
			<ul class="submenu">
			<li><a href="/extra/afmelden">Afmelden</a></li>
			</ul>
			-->
			<?php 
		}
		?>
		</div>
		</div>
		<?php
	}else {
		?>
		<div id="menu">
		<div id="submenu">
		<!-- <ul>
			<li><a href="/">Home</a></li>
			<li><a href="/schema/">Wedstrijdschema</a></li>
			<li><a href="/stats/">Statistieken</a></li>
			<li><a href="/kalender/">Kalender</a></li>
		</ul> -->
		<?php
		if($spelerId > 0) {
			// De speler is ingelogd, laat de subonderdelen zien
			?>
			<!--
			<ul class="submenu">
			<li><a href="/extra/afmelden">Afmelden</a></li>
			</ul>
			-->
			<?php 
		}
		?>
		</div>
		</div>
		<div id="header">
		<div id="subheader">
		<h1><a href="./">mijnhonkbal.nl</a></h1>
		<!-- <p class="subtitle">De site voor je honkbalteam</p> -->
		</div>
		</div>
		<?php
	}
}
?>
<div id="page">
<div id="subpage">